from flask import Flask
from front.views import front
from common.views import common
from cms.views import cms
from exts import db,mail
import setting
from flask_wtf import CSRFProtect
from utils.captcha import xtcaptcha

app=Flask(__name__)

app.config.from_object(setting)
app.register_blueprint(front)
app.register_blueprint(common)
app.register_blueprint(cms)
CSRFProtect(app)

db.init_app(app)
mail.init_app(app)

xtcaptcha.Captcha.gene_code()


if __name__=='__main__':
    app.run(debug=True)